package top.jiangqiang.qianyi.common.constants.http;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import top.jiangqiang.qianyi.common.base.http.ErrorStatus;

/**
 * 由于代码不正确导致的异常
 *
 * @Date 2023/10/19 17:28
 * @Author Jiangqiang
 */
@Getter
@Slf4j
@AllArgsConstructor
public enum Error500Status implements ErrorStatus {
    //500服务器内部出错
    INTERNAL_SERVER_ERROR(100, "服务器内部错误"),
    INTERNAL_ENUM_CLASS_NAME_IS_DUPLICATE(101, "枚举类名不允许重复：{}，请使用@{}注解进行自定义"),
    INTERNAL_UNSUPPORTED(102, "暂不支持"),
    INTERNAL_UPLOAD_FAIL(103, "文件上传失败"),
    INTERNAL_PLEASE_CHECK_THE_RSA_CONFIG(104, "请检查RSA配置"),
    INTERNAL_PLEASE_CHECK_THE_AES_CONFIG(105, "请检查AES配置"),
    INTERNAL_AES_KEY_DOES_NOT_SUPPORT_ENCRYPTION(106, "AES密钥不支持加密配置");

    //枚举编码
    private final int code;
    private final String message;

    @Override
    public int getRawStatusCode() {
        return 500;
    }

    @Override
    public HttpStatus getHttpStatus() {
        return HttpStatus.INTERNAL_SERVER_ERROR;
    }
}
